package brickbreaker;

import javafx.scene.Parent;
import javafx.scene.image.ImageView;

class Ball extends Parent {
    
    static final int DEFAULT_SIZE = 2;
    
    static final int MAX_SIZE = 5;

    private int size;

    private int diameter;
    private ImageView imageView;

    Ball() {
        imageView = new ImageView();
        getChildren().add(imageView);
        changeSize(DEFAULT_SIZE);
        setMouseTransparent(true);
    }

    int getSize() {
        return size;
    }

    int getDiameter() {
        return diameter;
    }

    final void changeSize(int newSize) {
        size = newSize;
        imageView.setImage(Config.getImages().get(Config.IMAGE_BALL_0 + size));
        diameter = (int) imageView.getImage().getWidth() - Config.SHADOW_WIDTH;
    }

}

